function Replenishment(params){ 
	 
}

Replenishment.Where = function(type,proxy){
	this.type = type;
	this.proxy=proxy;
	this.linked = null;
	this.set = null;
	if(this.type==0){
		this.set = new Replenishment.Where(1,true);
		this.set.linked = this;
	}
	this.getProxy = function(){
		var m = new Replenishment.Where(this.type);//当前的对像
		if(this.type==0){
			m.set = new Replenishment.Where(1,true);//set对象
			m.set.linked = m;
		}else{
			m.linked=this.linked;
			this.linked.linked=m;
		}
		return m;
	}
	this.data = {};
	this.put = function(key,value){
		this.data[key] = value;
	}
	this.get = function(key){
		return this.data[key];
	}
	/** 编号 [非空]       **/
	this.id=function(id){if(this.proxy)return this.getProxy().id(id);  this.put("id", id);return this;};
	/** and id is null */
	this.idNull=function(){if(this.proxy)return this.getProxy().idNull();if(this.get("idNot")==null)this.put("idNot", "");this.put("id", null);return this;};
	/** not .... */
	this.idNot=function(){if(this.proxy)return this.getProxy().idNot();this.put("idNot", "not");return this;};
	this.idNotNull=function(){if(this.proxy)return this.getProxy().idNotNull();this.put("idNot", "not");this.put("id", null);return this;};
	this.idNot=function(id){if(this.proxy)return this.getProxy().idNot(id);this.put("idNot", "not");this.put("id", id);return this;};
	/** and id <= ? */
	this.idMin=function(min){if(this.proxy)return this.getProxy().idMin(min);this.put("idMin", min);return this;};
	/** and id >= ? */
	this.idMax=function(max){if(this.proxy)return this.getProxy().idMax(max);this.put("idMax", max);return this;};
	this.idIn=function(ids){
		if(this.proxy)return this.getProxy().idIn(ids);  this.put("idIn", ids);return this;
	};	
	
	/** 补货信息 [非空] [Replenish]      **/
	this.replenish=function(replenish){if(this.proxy)return this.getProxy().replenish(replenish);  this.put("replenish", replenish);return this;};
	/** and replenish is null */
	this.replenishNull=function(){if(this.proxy)return this.getProxy().replenishNull();if(this.get("replenishNot")==null)this.put("replenishNot", "");this.put("replenish", null);return this;};
	/** not .... */
	this.replenishNot=function(){if(this.proxy)return this.getProxy().replenishNot();this.put("replenishNot", "not");return this;};
	this.replenishNotNull=function(){if(this.proxy)return this.getProxy().replenishNotNull();this.put("replenishNot", "not");this.put("replenish", null);return this;};
	this.replenishNot=function(replenish){if(this.proxy)return this.getProxy().replenishNot(replenish);this.put("replenishNot", "not");this.put("replenish", replenish);return this;};
	this.replenishIn=function(ids){
		if(this.proxy)return this.getProxy().replenishIn(ids);  this.put("replenishIn", ids);return this;
	};	
	
	/** 备注 [非空]       **/
	this.remarks=function(remarks){if(this.proxy)return this.getProxy().remarks(remarks);  this.put("remarks", remarks);return this;};
	/** and remarks is null */
	this.remarksNull=function(){if(this.proxy)return this.getProxy().remarksNull();if(this.get("remarksNot")==null)this.put("remarksNot", "");this.put("remarks", null);return this;};
	/** not .... */
	this.remarksNot=function(){if(this.proxy)return this.getProxy().remarksNot();this.put("remarksNot", "not");return this;};
	this.remarksNotNull=function(){if(this.proxy)return this.getProxy().remarksNotNull();this.put("remarksNot", "not");this.put("remarks", null);return this;};
	this.remarksNot=function(remarks){if(this.proxy)return this.getProxy().remarksNot(remarks);this.put("remarksNot", "not");this.put("remarks", remarks);return this;};
	
	/** 规格属性        **/
	this.attribute=function(attribute){if(this.proxy)return this.getProxy().attribute(attribute);  this.put("attribute", attribute);return this;};
	/** and attribute is null */
	this.attributeNull=function(){if(this.proxy)return this.getProxy().attributeNull();if(this.get("attributeNot")==null)this.put("attributeNot", "");this.put("attribute", null);return this;};
	/** not .... */
	this.attributeNot=function(){if(this.proxy)return this.getProxy().attributeNot();this.put("attributeNot", "not");return this;};
	this.attributeNotNull=function(){if(this.proxy)return this.getProxy().attributeNotNull();this.put("attributeNot", "not");this.put("attribute", null);return this;};
	this.attributeNot=function(attribute){if(this.proxy)return this.getProxy().attributeNot(attribute);this.put("attributeNot", "not");this.put("attribute", attribute);return this;};
	
	/** 单位     商品单位   **/
	this.company=function(company){if(this.proxy)return this.getProxy().company(company);  this.put("company", company);return this;};
	/** and company is null */
	this.companyNull=function(){if(this.proxy)return this.getProxy().companyNull();if(this.get("companyNot")==null)this.put("companyNot", "");this.put("company", null);return this;};
	/** not .... */
	this.companyNot=function(){if(this.proxy)return this.getProxy().companyNot();this.put("companyNot", "not");return this;};
	this.companyNotNull=function(){if(this.proxy)return this.getProxy().companyNotNull();this.put("companyNot", "not");this.put("company", null);return this;};
	this.companyNot=function(company){if(this.proxy)return this.getProxy().companyNot(company);this.put("companyNot", "not");this.put("company", company);return this;};
	
	/** 已补货        **/
	this.count=function(count){if(this.proxy)return this.getProxy().count(count);  this.put("count", count);return this;};
	/** and count is null */
	this.countNull=function(){if(this.proxy)return this.getProxy().countNull();if(this.get("countNot")==null)this.put("countNot", "");this.put("count", null);return this;};
	/** not .... */
	this.countNot=function(){if(this.proxy)return this.getProxy().countNot();this.put("countNot", "not");return this;};
	this.countNotNull=function(){if(this.proxy)return this.getProxy().countNotNull();this.put("countNot", "not");this.put("count", null);return this;};
	this.countNot=function(count){if(this.proxy)return this.getProxy().countNot(count);this.put("countNot", "not");this.put("count", count);return this;};
	/** and count <= ? */
	this.countMin=function(min){if(this.proxy)return this.getProxy().countMin(min);this.put("countMin", min);return this;};
	/** and count >= ? */
	this.countMax=function(max){if(this.proxy)return this.getProxy().countMax(max);this.put("countMax", max);return this;};
	this.countIn=function(ids){
		if(this.proxy)return this.getProxy().countIn(ids);  this.put("countIn", ids);return this;
	};	
	
	/** 已配出        **/
	this.matchOut=function(matchOut){if(this.proxy)return this.getProxy().matchOut(matchOut);  this.put("matchOut", matchOut);return this;};
	/** and match_out is null */
	this.matchOutNull=function(){if(this.proxy)return this.getProxy().matchOutNull();if(this.get("matchOutNot")==null)this.put("matchOutNot", "");this.put("matchOut", null);return this;};
	/** not .... */
	this.matchOutNot=function(){if(this.proxy)return this.getProxy().matchOutNot();this.put("matchOutNot", "not");return this;};
	this.matchOutNotNull=function(){if(this.proxy)return this.getProxy().matchOutNotNull();this.put("matchOutNot", "not");this.put("matchOut", null);return this;};
	this.matchOutNot=function(matchOut){if(this.proxy)return this.getProxy().matchOutNot(matchOut);this.put("matchOutNot", "not");this.put("matchOut", matchOut);return this;};
	/** and match_out <= ? */
	this.matchOutMin=function(min){if(this.proxy)return this.getProxy().matchOutMin(min);this.put("matchOutMin", min);return this;};
	/** and match_out >= ? */
	this.matchOutMax=function(max){if(this.proxy)return this.getProxy().matchOutMax(max);this.put("matchOutMax", max);return this;};
	this.matchOutIn=function(ids){
		if(this.proxy)return this.getProxy().matchOutIn(ids);  this.put("matchOutIn", ids);return this;
	};	
	
	/** 还欠        **/
	this.owe=function(owe){if(this.proxy)return this.getProxy().owe(owe);  this.put("owe", owe);return this;};
	/** and owe is null */
	this.oweNull=function(){if(this.proxy)return this.getProxy().oweNull();if(this.get("oweNot")==null)this.put("oweNot", "");this.put("owe", null);return this;};
	/** not .... */
	this.oweNot=function(){if(this.proxy)return this.getProxy().oweNot();this.put("oweNot", "not");return this;};
	this.oweNotNull=function(){if(this.proxy)return this.getProxy().oweNotNull();this.put("oweNot", "not");this.put("owe", null);return this;};
	this.oweNot=function(owe){if(this.proxy)return this.getProxy().oweNot(owe);this.put("oweNot", "not");this.put("owe", owe);return this;};
	/** and owe <= ? */
	this.oweMin=function(min){if(this.proxy)return this.getProxy().oweMin(min);this.put("oweMin", min);return this;};
	/** and owe >= ? */
	this.oweMax=function(max){if(this.proxy)return this.getProxy().oweMax(max);this.put("oweMax", max);return this;};
	this.oweIn=function(ids){
		if(this.proxy)return this.getProxy().oweIn(ids);  this.put("oweIn", ids);return this;
	};	
	
	/** 补货商品 [非空] [Commodity]      **/
	this.commodity=function(commodity){if(this.proxy)return this.getProxy().commodity(commodity);  this.put("commodity", commodity);return this;};
	/** and commodity is null */
	this.commodityNull=function(){if(this.proxy)return this.getProxy().commodityNull();if(this.get("commodityNot")==null)this.put("commodityNot", "");this.put("commodity", null);return this;};
	/** not .... */
	this.commodityNot=function(){if(this.proxy)return this.getProxy().commodityNot();this.put("commodityNot", "not");return this;};
	this.commodityNotNull=function(){if(this.proxy)return this.getProxy().commodityNotNull();this.put("commodityNot", "not");this.put("commodity", null);return this;};
	this.commodityNot=function(commodity){if(this.proxy)return this.getProxy().commodityNot(commodity);this.put("commodityNot", "not");this.put("commodity", commodity);return this;};
	this.commodityIn=function(ids){
		if(this.proxy)return this.getProxy().commodityIn(ids);  this.put("commodityIn", ids);return this;
	};	
	
	/** 修改时间 [非空]       **/
	this.updateTime=function(updateTime){if(this.proxy)return this.getProxy().updateTime(updateTime);  this.put("updateTime", updateTime);return this;};
	/** and update_time is null */
	this.updateTimeNull=function(){if(this.proxy)return this.getProxy().updateTimeNull();if(this.get("updateTimeNot")==null)this.put("updateTimeNot", "");this.put("updateTime", null);return this;};
	/** not .... */
	this.updateTimeNot=function(){if(this.proxy)return this.getProxy().updateTimeNot();this.put("updateTimeNot", "not");return this;};
	this.updateTimeNotNull=function(){if(this.proxy)return this.getProxy().updateTimeNotNull();this.put("updateTimeNot", "not");this.put("updateTime", null);return this;};
	this.updateTimeNot=function(updateTime){if(this.proxy)return this.getProxy().updateTimeNot(updateTime);this.put("updateTimeNot", "not");this.put("updateTime", updateTime);return this;};
	/** and update_time >= ? */
	this.updateTimeStart=function(start){if(this.proxy)return this.getProxy().updateTimeStart(start);this.put("updateTimeStart", start);return this;};			
	/** and update_time <= ? */
	this.updateTimeEnd=function(end){if(this.proxy)return this.getProxy().updateTimeEnd(end);this.put("updateTimeEnd", end);return this;};
	
	/** 添加时间 [非空]       **/
	this.addTime=function(addTime){if(this.proxy)return this.getProxy().addTime(addTime);  this.put("addTime", addTime);return this;};
	/** and add_time is null */
	this.addTimeNull=function(){if(this.proxy)return this.getProxy().addTimeNull();if(this.get("addTimeNot")==null)this.put("addTimeNot", "");this.put("addTime", null);return this;};
	/** not .... */
	this.addTimeNot=function(){if(this.proxy)return this.getProxy().addTimeNot();this.put("addTimeNot", "not");return this;};
	this.addTimeNotNull=function(){if(this.proxy)return this.getProxy().addTimeNotNull();this.put("addTimeNot", "not");this.put("addTime", null);return this;};
	this.addTimeNot=function(addTime){if(this.proxy)return this.getProxy().addTimeNot(addTime);this.put("addTimeNot", "not");this.put("addTime", addTime);return this;};
	/** and add_time >= ? */
	this.addTimeStart=function(start){if(this.proxy)return this.getProxy().addTimeStart(start);this.put("addTimeStart", start);return this;};			
	/** and add_time <= ? */
	this.addTimeEnd=function(end){if(this.proxy)return this.getProxy().addTimeEnd(end);this.put("addTimeEnd", end);return this;};
	
	/** 状态 [非空]   1:正常 0:无效     **/
	this.status=function(status){if(this.proxy)return this.getProxy().status(status);  this.put("status", status);return this;};
	/** and status is null */
	this.statusNull=function(){if(this.proxy)return this.getProxy().statusNull();if(this.get("statusNot")==null)this.put("statusNot", "");this.put("status", null);return this;};
	/** not .... */
	this.statusNot=function(){if(this.proxy)return this.getProxy().statusNot();this.put("statusNot", "not");return this;};
	this.statusNotNull=function(){if(this.proxy)return this.getProxy().statusNotNull();this.put("statusNot", "not");this.put("status", null);return this;};
	this.statusNot=function(status){if(this.proxy)return this.getProxy().statusNot(status);this.put("statusNot", "not");this.put("status", status);return this;};
	this.statusIn=function(ids){
		if(this.proxy)return this.getProxy().statusIn(ids);  this.put("statusIn", ids);return this;
	};	
	
	
	
	this.add=function(key,value) {if(proxy)return proxy().add(key,value);this.put(key, value);return this;}
	this.desc=function(sql) {if(proxy)return proxy().desc(sql);this.put("desc", sql);return this;}
	this.asc=function(sql) {if(proxy)return proxy().asc(sql);this.put("asc", sql);return this;}
	this.definex=function(sql) {if(proxy)return proxy().definex(sql);this.put("definex", sql);return this;}
	
	/** 获取所有补货明细 **/
	this.list=function(size){
		this.data.size = size;
		var protocol = ux.ajax("/admin/delivery/replenishment.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list)return protocol.data.list;
		return [];
	}
	/** 获取补货明细分页 **/
	this.page=function(page,size){
		this.data.size = size;
		this.data.page = page;
		var protocol = ux.ajax("/admin/delivery/replenishment.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data)return data;
		return {list:[]};
	}
	/** 根据查询条件取补货明细 **/
	this.get=function(){
		this.data.size = 1;
		var protocol = ux.ajax("/admin/delivery/replenishment.list.do",this.data);
		if(!protocol)return null;
		if(protocol.data && protocol.data.list && protocol.data.list.length==1)return protocol.data.list[0]; 
		return null;
	}
}

Replenishment.get = function(id){
	var protocol = ux.ajax("/admin/delivery/replenishment.get.do",{id:id});
	if(!protocol)return null;
	if(protocol.data)return protocol.data.replenishment;
	return null;
}

Replenishment.where = new Replenishment.Where(0,true);